/*
 * LinkedList.cpp
 *
 *  Created on: Apr 6, 2013
 *      Author: Anthony Varghese
 */

#include <iostream>
using std::ostream;
using std::cout;
using std::endl;

#include "LinkedList.h"

namespace lab8 {

LinkedList::LinkedList() : first(NULL) {
	cout << "Default constructor for LinkedList" << endl;
}

LinkedList::~LinkedList() {
	cout << "Destructor for LinkedList" << endl;

}

//LinkedList::LinkedList(const LinkedList& source) {
//	cout << "Copy constructor for LinkedList" << endl;
//
//}

//LinkedList& LinkedList::operator =(const LinkedList& rhs){
//	cout << "Assignment operator for LinkedList" << endl;
//	if (this == &rhs)
//		return *this;
//
//	return *this;
//}

void LinkedList::insert(short s, double d){
	LinkedList::Node* temp = first;
	first = new LinkedList::Node();
	first->v1 = s;
	first->v2 = d;
	first->next = temp;
}

ostream& operator<<(ostream& os, const LinkedList::Node& n){
	os << n.v1 << " " << n.v2;
	return os;
}

ostream& operator<<(ostream& os, const LinkedList& ls){
	for (LinkedList::Node* temp = ls.first; temp != NULL; temp = temp->next )
		os << *temp << endl;
	return os;
}
} /* namespace lab8 */
